package com.casic.ops.handler.app.action;

import com.casic.ops.consts.app.ActionType;
import com.orion.remote.channel.BaseExecutor;
import com.orion.utils.io.Streams;


/**
 * @ClassName ops-platform
 * @Description 执行操作-传输产物
 * @see ActionType#RELEASE_TRANSFER
 * @Author mianbin
 * @Date 2022/5/31 10:59
 * @Version 1.0
 **/
public abstract class AbstractTransferActionHandler<E extends BaseExecutor> extends AbstractActionHandler {

    protected E executor;

    public AbstractTransferActionHandler(Long actionId, MachineActionStore store) {
        super(actionId, store);
    }

    @Override
    public void terminate() {
        super.terminate();
        // 关闭executor
        Streams.close(executor);
    }

    @Override
    public void close() {
        super.close();
        // 关闭executor
        Streams.close(executor);
    }

}
